/*
 * @Author: sbotlp
 * @Email: sbotlp@sina.com
 * @Date: 2019-11-03 20:04:57
 * @LastEditTime: 2019-11-03 20:45:14
 * @Description: http://www.sbotlp.com.cn
 */
function loadImg(src, callback, fail) {
  var img = document.createElement('img');
  img.onload = function() {
    callback(img);
  }
  img.onerror = function(e) {
    fail(e);
  }
  img.src = src;
}
var src = 'https://api.sbotlp.com.cn/public/image/20190924/1569308973.png';
loadImg(src, function(event) {
  console.log('event: ', event);
  console.log('event.width: ', event.width);
}, function(e) {
  console.log('e: ', e);
})